local Class = require('lua.lang.Class')
local LuaValue = require('lua.vm.LuaValue')

--- @class LuaTable : LuaValue
--- @field t table<LuaValue, LuaValue>
--- @field m_metatable LuaTable
local LuaTable = Class {
	__extends = LuaValue
}

--- @constructor
--- @param t table | nil
--- @return LuaTable
function LuaTable:new(t)
	--- @type LuaTable
	local o = {
		t = t or {}
	}
	return setmetatable(o, LuaTable)
end

--- @param key LuaValue | number
--- @return LuaValue
function LuaTable:get(key)
	return self.t[key]
end

--- @param key LuaValue | number
--- @param value LuaValue
--- @return void
function LuaTable:set(key, value)
	self.t[key] = value
end

return LuaTable